//
//  HLEmojiCollectionCell.m
//  YueYue
//
//  Created by hulu001 on 2023/6/13.
//

#import "HLEmojiCollectionCell.h"


@interface HLEmojiCollectionCell ()

@property (nonatomic, strong) UIImageView *imageView;

@end

@implementation HLEmojiCollectionCell

-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    self.imageView = [[UIImageView alloc] init];
    _imageView.contentMode = UIViewContentModeScaleAspectFit;
    [self.contentView addSubview:_imageView];
    [_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
}

- (void)setModel:(HLEmojiModel *)model
{
    _model = model;
    [_imageView sd_setImageWithURL:[NSURL URLWithString:model.thumb.gif] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
        model.image = image;
    }];
}

@end
